home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / turbovis / dlgdsn22.zip / DLGDSN.DOC < prev    next >
Text File  |  1993-01-03  |  9KB  |  331 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                                           January 3, 1993
  9.  
  10.                                  Dialog Design
  11.  
  12.                   A Dialogbox Design Program for Turbo Vision
  13.  
  14.                                   Version 2.2
  15.  
  16.                    (C) Copyright 1990-3 by L. David Baldwin.  
  17.                              All Rights Reserved.
  18.  
  19.   Further copyright information given below.
  20.  
  21.  
  22.   OVERVIEW
  23.  
  24.   Dialog Design takes some of the pain out of designing dialog boxes for 
  25.   Borland's Turbo Vision package.  With Dialog Design, dialog controls can be 
  26.   easily added, edited, rearranged, and the dialogbox itself sized, moved, 
  27.   etc.  Once the design is satisfactory, Dialog Design can produce source 
  28.   code to be included in your program or a resource file for use by your 
  29.   program.
  30.  
  31.  
  32.   REQUIREMENTS
  33.  
  34.     Borland's Turbo Pascal(R) version 6.0
  35.     Some familiarity with the Turbo Vision package
  36.     A mouse is desirable
  37.  
  38.  
  39.   DESIGNING A DIALOG BOX
  40.  
  41.   Dialog Design has three modes of operation:
  42.  
  43.     Design Mode
  44.  
  45.     Dialog Design begins in design mode and this is the mode that you use for 
  46.     all layout work and editing.  In design mode, the dialogbox doesn't look 
  47.     or act quite like it will in the final design.  Here's some of the 
  48.     differences:
  49.  
  50.        A 'canvas' background is used to better delineate the actual space 
  51.        occupied by the controls.
  52.  
  53.        Controls are colored red when selected.
  54.  
  55.        Multiple controls may be selected.
  56.  
  57.        All controls may be selected even those not normally selectable.
  58.  
  59.  
  60.  
  61.  
  62.                                       1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.     Try Mode
  75.  
  76.     Try mode is entered using the F9 key.  In try mode, the dialogbox behaves 
  77.     as it's supposed to.  You can check the Tab order, make temporary 
  78.     entries, and push buttons to actually check how things will work.  Exit 
  79.     try mode with the escape key or click on the close box.
  80.  
  81.     Ordering Mode
  82.  
  83.     Ordering mode allows you to change the Tab order of your dialogbox.  The 
  84.     method for doing this is discussed further below.  The F8 key toggles you 
  85.     into and out of ordering mode.
  86.  
  87.   While there is no fixed way to design a dialogbox, here's one suggested 
  88.   sequence:
  89.  
  90.   1.In design mode, work with the dialogbox large enough so that you won't be 
  91.     crowded. 
  92.  
  93.   2.From the Add menu, select a control to add.  This will bring up a dialog 
  94.     where you can enter the necessary information.  Use the online help (F1 
  95.     key) if you have a question as to what goes in a particular field.  When 
  96.     the OK button is pushed, the control will appear in the lower right 
  97.     corner of the design box.  The control is then positioned by dragging it 
  98.     with the mouse, or by using the arrow keys (Shift+arrow moves a little 
  99.     faster).  Work in the upper left corner of the box.
  100.  
  101.   3.Continue adding controls as desired.  At any time, controls can be 
  102.     repositioned or sized with the mouse (further details below).  If 
  103.     something other than position or size needs changing, select the control 
  104.     and from the Edit menu choose Edit Selected (or use F7).  This will bring 
  105.     up its dialogbox for changes.
  106.  
  107.   4.When all the controls have been added and positioned, size the box to fit 
  108.     and move it to the desired location on the desktop.  Be sure and add a 
  109.     title (Edit Dialog from the Edit menu).
  110.  
  111.   5.Enter Try Mode with the F9 key and test the dialogbox.  Be sure to check 
  112.     how the controls sequence using the Tab key.  Exit Try mode with Esc or 
  113.     click on the close box.
  114.  
  115.   6.If the Tab sequence needs changing, use F8 to enter ordering mode.  With 
  116.     the mouse, click on each control to establish the desired order.   Exit 
  117.     back to design mode with F8.
  118.  
  119.     Changing the sequence without a mouse is a little more complicated.  Use 
  120.     the Tab key to select (highlight) the next control to be sequenced.  Then 
  121.     press the Enter key to enter the selected control into the sequence.  
  122.     After all controls have been entered, exit back to design mode with F8.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                       2
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.     Some controls (such as Static Text, and Labels) don't enter into the 
  141.     tab sequence of a dialogbox.  You can order these if it's convenient, but 
  142.     the order won't effect the final results.  
  143.  
  144.     Be sure to recheck the tab order in Try mode.
  145.  
  146.   7.This is a good time to save your work.  Choose Save or Save As from the 
  147.     File menu to create or update a .DLG file.  Any file with the same name 
  148.     will be renamed with a .BKP extension.
  149.  
  150.   8.You can preview the source code to be generated by choosing Write Source 
  151.     to Screen from the Operations menu.  The code will appear in a viewer 
  152.     window.
  153.  
  154.   9.To create source code for your dialogbox, choose Write Source to File 
  155.     from the Operations menu and choose a filename (.SRC is the default 
  156.     extension).  The source code produced will consist of a dialogbox 
  157.     definition function and a data record with fields matching those required 
  158.     by the dialogbox's SetData and GetData methods.
  159.  
  160.     The .SRC file generated may be inserted directly into TESTCASE.PAS (at 
  161.     the line of asterisks) to provide a program to test the dialogbox.
  162.  
  163.   10.To generate a resource file or add the new dialogbox to an existing 
  164.     resource or EXE file, choose Write Resource from the Operation menu.  
  165.     Both a filename and a resource ID name will be requested.  If the file 
  166.     already exists, it will be renamed with a .BKP extension.  If the 
  167.     existing file is a resource or EXE file, it will be copied, and the new 
  168.     resource added to the copy.  Any existing resource with the same ID will 
  169.     be deleted.  Note that the resource ID name is case sensitive.
  170.  
  171.  
  172.   SELECTING, CLICKING, DRAGGING, SIZING, ETC.
  173.  
  174.   To select a control, click and release on it with the left button or use 
  175.   the Tab key.
  176.  
  177.   To select multiple controls, select the first, then hold down the shift key 
  178.   while clicking on the others.  Note that, in this mode, clicking toggles 
  179.   selection on and off so it's possible to deselect as well as select.
  180.  
  181.   To select all controls, use the F4 key.
  182.  
  183.   To move controls, select the controls to be moved, then click on any one of 
  184.   them and, without releasing the button, drag the group to the desired 
  185.   position.  The group may also be moved using the arrow keys.
  186.  
  187.   To resize a control first select it then click and drag on its lower right 
  188.   corner.  Note that some controls only size in one dimension and all have a 
  189.   minimum size.
  190.  
  191.  
  192.  
  193.  
  194.                                       3
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   To edit a control, double click it with the left button or click on it with 
  207.   the right button.  Or select it with the Tab key and press F7.  Either way 
  208.   brings up the control's Add/Edit dialog.
  209.  
  210.  
  211.   SOME DETAILS
  212.  
  213.   Options Button
  214.  
  215.   Most of the Add/Edit dialogs have an Options button.  This button brings up  
  216.   another dialog which will let you change the default ofXXXX and evXXXX flag 
  217.   and mask bits.  In most cases, you'll want to stick with defaults but some 
  218.   bits do have interesting uses.  In particular, the ofFramed bit can be used 
  219.   for framing controls.  Also, with a little effort, you can frame groups of 
  220.   controls or divide the dialog into panes.  The context sensitive help (F1) 
  221.   for the options dialog has some hints on this.
  222.  
  223.   Help Context
  224.  
  225.   Many of the Add/Edit dialogboxes also have fields labeled Help Context and 
  226.   Value.  By default, these contain hcNoContext and 0.  Dialog Design uses 
  227.   the help context ID when generating source code and the value when 
  228.   producing a resource.
  229.  
  230.   For small projects, it may be convenient just to enter this information by 
  231.   hand.  However, if you're using Borland's demo help compiler, TVHC, Dialog 
  232.   Design can work with the help definition file it produces.  To do this, 
  233.   choose Load Help ctx file from the Options menu and supply the filename of 
  234.   the help definition file.  Then clicking on the